package serveurPoste;

public class Dossier {
	private int mId;
	private String mNom;
	private String mNoPermis;
	private String mNoPlaque;
	private String mPrenom;
	private int mNiveau;
	private int mListeInfraction[];
	private int mListeReaction[];
	private int mCurrentInfraction =0;
	private int mCurrentReaction =0;
	
	
	public Dossier(int id, String nom, String noPermis, String noPlaque, String prenom)
	{
		this.mId = id;
		this.mNom = nom;
		this.mNoPermis = noPermis;
		this.mNoPlaque = noPlaque;
		this.mPrenom = prenom;
		
		mListeInfraction = new int[100];
		mListeReaction = new int[100];
		
		for(int i=0; i<100; i++){
			mListeInfraction[i] = -1;
			mListeReaction[i] = -1;
		}
	
	}
	
	public int id(){
		return mId;
	}
	
	public String nom(){
		return mNom;
	}
	
	public String noPermis(){
		return mNoPermis;
	}
	
	public String noPlaque(){
		return mNoPlaque;
	}
	
	public String prenom(){
		return mPrenom;
	}
	
	public int niveau(){
		return mNiveau;
	}
	
	public int[] getListeReaction(){
		return mListeReaction;
	}
	
	public int[] getListeInfraction(){
		return mListeInfraction;
	}
	
	public void ajouterReactionAListe(int idReaction){
		mListeReaction[mCurrentReaction] = idReaction;
		mCurrentReaction++;
	}
	
	public void ajouterInfractionAListe(int idInfraction){
		mListeInfraction[mCurrentInfraction] = idInfraction;
		mCurrentInfraction++;
	}
	

	public String toString(){
		return "Dossier id"+mId +" " + mNom +", " + mPrenom + "\npermis : " +mNoPermis +" plaque : "+ mNoPlaque +"\n niveau : " + mNiveau;
	}
	
	public void miseAJourNiveau(int newNiveau){
		
			if(newNiveau > mNiveau)
				mNiveau = newNiveau;
	}
}
